package com.xbongbong.paas.service;

import com.xbongbong.paas.field.DefaultAttrPoJo;
import com.xbongbong.paas.pojo.IdNamePropertyPojo;
import com.xbongbong.paas.toolbox.wrap.BaseDTO;
import com.xbongbong.pro.workreportset.pojo.WorkReportSetVisibleRange;
import com.xbongbong.pro.workreportset.pojo.dto.WorkReportSetDetailDTO;
import com.xbongbong.pro.workreportset.pojo.dto.WorkReportSetSaveDTO;
import com.xbongbong.pro.workreportset.pojo.vo.WorkReportSetDetailVO;
import com.xbongbong.paas.toolbox.exception.XbbException;
import com.xbongbong.paas.toolbox.wrap.XbbResponse;
import com.xbongbong.pro.workreportset.pojo.vo.WorkReportSetFormVO;
import com.xbongbong.saas.domain.entity.WorkReportSetEntity;
import com.xbongbong.sys.domain.entity.UserEntity;

import java.util.List;

/**
 * @author youli.chen
 * @ProjectName xbb-pro
 * @Description: 工作报告设置方法
 * @date 2019/1/17 10:18
 */
public interface WorkReportSetService {

    /**
     * 【web】获取工作报告设置
     * @param workReportSetDetailDTO
     * @return
     * @throws XbbException
     */
    XbbResponse<WorkReportSetDetailVO> workReportSet(WorkReportSetDetailDTO workReportSetDetailDTO) throws XbbException;

    /**
     * 【web】保存工作报告设置
     * @param workReportSetSaveDTO
     * @return
     * @throws XbbException
     */
    XbbResponse<Integer> workReportSetSave(WorkReportSetSaveDTO workReportSetSaveDTO) throws XbbException;

    /**
     * 工作报告表单（日，周，月）
     *
     * @param baseDTO
     * @throws
     * @author long.rao
     * @date 2019-07-22 15:01
     */
    WorkReportSetFormVO formList(BaseDTO baseDTO) throws XbbException;

    /**
     * 当前用户是否有相应的新建工作报告功能
     * @param userEntity 用户实体
     * @return
     * @throws
     *
     * @author hongxiao
     * @date: 2019-03-13 15:57
     * @since v1.0
     * @version v1.0
     */
    WorkReportSetVisibleRange getVisibleRange(UserEntity userEntity);

    /**
     * 将 userIds 与设置的范围取交集
     * @param corpid 公司id
     * @param type 工作报告类型
     * @return
     * @throws
     *
     * @author hongxiao
     * @date: 2019-03-13 15:58
     * @since v1.0
     * @version v1.0
     */
    List<String> settingUsersFilter(String corpid , Integer type);

    /**
     * 当前登录人 所属部门和默认发送人所属部门 取交集获取抄送人
     * @param userEntity
     * @param type
     * @return
     */
    DefaultAttrPoJo getCcUser(UserEntity userEntity, Integer type) throws XbbException;

    /**
     * 当前登陆人 所属部门和默认发送人所属部门 取交集获取批阅人
     * @param userEntity
     * @param type
     * @return
     */
    DefaultAttrPoJo getApprovedPeople(UserEntity userEntity,Integer type) throws XbbException;

    /**
     *
     * @param userEntity
     * @param type
     * @return
     * @throws XbbException
     */
    List<IdNamePropertyPojo> getApprovedPeopleList(UserEntity userEntity, Integer type) throws XbbException ;

    /**
     * 初始化公司使用
     *
     * @param corpid 公司id
     * @param userId 员工id
     * @param type 报告类型
     * @throws
     * @return
     * @author hongxiao
     * @date 2019-11-14 10:09
     * @since
     * @version
     */
    WorkReportSetEntity initSetting(String corpid, String userId, Integer type) throws XbbException;
}
